<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

	<ui:composition template="/template.xhtml">
		<ui:define name="content">
			<p:layoutUnit position="west" size="50" style="border:none;">  
		    </p:layoutUnit>  
		  
		    <p:layoutUnit position="east" size="50" style="border:none;">  
		    </p:layoutUnit>
		    
			<p:layoutUnit position="center" styleClass="telaPrincipal"> 
				<h:form id="formCadastro">
					<p:panelGrid>
						<p:row>
							<p:column colspan="7" styleClass="ui-widget-header">
								<div align="center" class="tituloPrincipal">Cadastro de Aluno</div>
							</p:column>
						</p:row>
						
						<p:row>
							<p:column>
								<p:outputLabel for="matricula" value="Matricula: " />
							</p:column>
							<p:column colspan="4">
								<p:inputText id="matricula" size="30" value="#{alunoBean.aluno.matricula}" />
							</p:column>
							
							<p:column rowspan="5" colspan="2">
								<div align="center" id="divAvatar">
									<p:graphicImage id="photoAvatar" value="#{arquivoBean.streamContentAvatar}" width="150" height="150" cache="false" rendered="#{arquivoBean.streamContentAvatar != null}"/>
									<p:graphicImage value="/images/avatar_padrao.jpg" width="150" height="150" rendered="#{arquivoBean.streamContentAvatar == null}"/>
								</div>
							</p:column>
						</p:row>
						
						<p:row>
							<p:column>
								<p:outputLabel for="nome" value="Nome: " />
							</p:column>
							<p:column colspan="4">
								<p:inputText id="nome" size="90" value="#{alunoBean.aluno.nome}" />
							</p:column>
						</p:row>
	
						<p:row>
							<p:column colspan="5" styleClass="ui-widget-header">Filiação:</p:column>
						</p:row>
	
						<p:row>
							<p:column>
								<p:outputLabel for="filicao-pai" value="Pai: " />
							</p:column>
							<p:column colspan="4">
								<p:inputText id="filicao-pai" size="90" value="#{alunoBean.aluno.pai}" />
							</p:column>
						</p:row>
						
						<p:row>
							<p:column>
								<p:outputLabel for="filicao-mae" value="Mãe: " />
							</p:column>
							<p:column colspan="4">
								<p:inputText id="filicao-mae" size="90" value="#{alunoBean.aluno.mae}" />
							</p:column>
						</p:row>
	
						<p:row>
							<p:column>
								<p:outputLabel for="dt-nascimento" value="Data de Nascimento: " />
							</p:column>
							<p:column>
								<p:calendar id="dt-nascimento" navigator="true" display="inline" showOn="button" pattern="dd/MM/yyyy" placeholder="dd/mm/yyyy"
									yearRange="c-90:c" value="#{alunoBean.aluno.dataNascimento}" />
							</p:column>
							
							<p:column>
								<p:outputLabel for="local-nasc" value="Local: " />
							</p:column>
							<p:column colspan="2">
								<p:inputText id="local-nasc" size="25" value="#{alunoBean.aluno.local}" />
							</p:column>
	
							<p:column colspan="2">
								<div align="center">
									<p:commandButton id="modalUploadFoto" value="Upload Foto" icon="ui-icon-circle-arrow-n" onclick="dialogUploadFoto.show();" />
								</div>
							</p:column>
						</p:row>
	
						<p:row>
							<p:column colspan="7" styleClass="ui-widget-header">Documentação:</p:column>
						</p:row>
	
						<p:row>
							<p:column>
								<p:outputLabel for="rg" value="RG: " />
							</p:column>
							<p:column>
								<p:inputText id="rg" size="25" value="#{alunoBean.aluno.rg}" />
							</p:column>
							<p:column>
								<p:outputLabel for="orgao" value="Órgão: " />
							</p:column>
							<p:column colspan="3">
								<p:inputText id="orgao" size="25" value="#{alunoBean.aluno.orgao}" />
							</p:column>
						</p:row>
						
						<p:row>
							<p:column>
								<p:outputLabel for="dt-expedicao" value="Expedida em: " />
							</p:column>
							<p:column>
								<p:calendar id="dt-expedicao" navigator="true" display="inline" showOn="button" pattern="dd/MM/yyyy" placeholder="dd/mm/yyyy"
									yearRange="c-30:c" value="#{alunoBean.aluno.rgExpedida}" />
							</p:column>
							<p:column>
								<p:outputLabel for="cpf" value="CPF: " />
							</p:column>
							<p:column colspan="3">
								<p:inputMask id="cpf" mask="999.999.999-99" size="25" value="#{alunoBean.aluno.cpf}" />
							</p:column>
						</p:row>
	
						<p:row>
							<p:column colspan="6" styleClass="ui-widget-header"><p:spacer height="0" /></p:column>
						</p:row>
	
						<p:row>
							<p:column>
								<p:outputLabel for="endereco" value="Endereço: " />
							</p:column>
							<p:column colspan="5">
								<p:inputText id="endereco" size="78" value="#{alunoBean.aluno.endereco}" />
							</p:column>
						</p:row>
						
						<p:row>
							<p:column>
								<p:outputLabel for="bairro" value="Bairro: " />
							</p:column>
							<p:column>
								<p:inputText id="bairro" size="25" value="#{alunoBean.aluno.bairro}" />
							</p:column>
							
							<p:column>
								<p:outputLabel for="cidade" value="Cidade: " />
							</p:column>
							<p:column>
								<p:inputText id="cidade" size="25" value="#{alunoBean.aluno.cidade}" />
							</p:column>
							
							<p:column>
								<p:outputLabel for="cep" value="CEP: " />
							</p:column>
							<p:column>
								<p:inputMask id="cep" mask="99999-999" size="20" value="#{alunoBean.aluno.cep}" />
							</p:column>
						</p:row>
						
						<p:row>
							<p:column>
								<p:outputLabel for="email" value="Email: " />
							</p:column>
							<p:column colspan="3">
								<p:inputText id="email" size="70" value="#{alunoBean.aluno.email}" />
							</p:column>
							
							<p:column>
								<p:outputLabel for="estado-civil" value="Estado Civil: " />
							</p:column>
							<p:column>
								<p:selectOneMenu id="estado-civil" value="#{alunoBean.aluno.estadoCivil}">
									<f:selectItem itemLabel="Selecione" itemValue="" />
									<f:selectItems value="#{alunoBean.listaEstadoCivil}" var="civil" itemLabel="#{civil}" itemValue="#{civil}" />
								</p:selectOneMenu>
							</p:column>
						</p:row>
	
						<p:row>
							<p:column>
								<p:outputLabel for="tel-res" value="Tel.Res: " />
							</p:column>
							<p:column>
								<p:inputMask id="tel-res" mask="(99) 9999-9999" size="25" placeholder="(xx) xxxx-xxxx" value="#{alunoBean.aluno.telResidencial}" />
							</p:column>
							
							<p:column>
								<p:outputLabel for="tel-cel" value="Tel.Cel: " />
							</p:column>
							<p:column>
								<p:inputMask id="tel-cel" mask="(99) 99999-9999" size="25" placeholder="(xx) xxxxx-xxxx" value="#{alunoBean.aluno.telCelular}" />
							</p:column>
							
							<p:column>
								<p:outputLabel for="radio" value="Radio: " />
							</p:column>
							<p:column>
								<p:inputText id="radio" size="25" value="#{alunoBean.aluno.telRadio}" />
							</p:column>
						</p:row>
	
						<p:row>
							<p:column>
								<p:outputLabel for="grau-instrucao" value="Grau de Instrução: " />
							</p:column>
							
							<p:column>
								<p:selectOneMenu id="grau-instrucao" value="#{alunoBean.aluno.grauInstrucao}">
									<f:selectItem itemLabel="Selecione" itemValue="" />
									<f:selectItems value="#{alunoBean.listaGrauInstrucao}" var="grau" itemLabel="#{grau}" itemValue="#{grau}"/>
								</p:selectOneMenu>
							</p:column>
							
							<p:column>
								<p:outputLabel for="profissao" value="Profissão: " />
							</p:column>
							<p:column colspan="3">
								<p:inputText id="profissao" size="40" value="#{alunoBean.aluno.profissao}" />
							</p:column>
						</p:row>
						
						<p:row>
							<p:column colspan="6" styleClass="ui-widget-header"><p:spacer height="0" /></p:column>
						</p:row>
						
						<p:row>
							<p:column>
								<p:outputLabel for="igreja-congrega" value="Igreja que congrega: " />
							</p:column>
							<p:column colspan="2">
								<p:inputText id="igreja-congrega" size="30" value="#{alunoBean.aluno.igrejaCongrega}" />
							</p:column>
							
							<p:column>
								<p:outputLabel for="igreja-presidente" value="Nome do Pastor Presidente: " />
							</p:column>
							<p:column colspan="2">
								<p:inputText id="igreja-presidente" size="30" value="#{alunoBean.aluno.pastorPresidente}" />
							</p:column>
						</p:row>
						
						<p:row>
							<p:column>
								<p:outputLabel for="igreja-endereco" value="Endereço:" />
							</p:column>
							<p:column colspan="5">
								<p:inputText id="igreja-endereco" size="70" value="#{alunoBean.aluno.igrejaEndereco}" />
							</p:column>
						</p:row>
						
						<p:row>
							<p:column>
								<p:outputLabel for="igreja-cargo" value="Cargo ou Função na Igreja: " />
							</p:column>
							<p:column colspan="2">
								<p:inputText id="igreja-cargo" size="30" value="#{alunoBean.aluno.igrejaCargo}" />
							</p:column>
							
							<p:column>
								<p:outputLabel for="curso-pretendido" value="Curso Pretendido: " />
							</p:column>
							<p:column colspan="2">
								<p:inputText id="curso-pretendido" size="30" value="#{alunoBean.aluno.cursoPretendido}" />
							</p:column>
						</p:row>

						<p:row>
							<p:column colspan="7">
								<div align="right">
									<p:commandButton id="btn-cancelar" action="#{alunoBean.cancelarCadastro}" value="Cancelar" icon="ui-icon-closethick" style="margin:10px"/>
									<p:commandButton id="btn-add-modulo" action="#{moduloBean.avancarModulos}" value="Avançar" icon="ui-icon-seek-next" style="margin:10px"/>
								</div>
							</p:column>
						</p:row>						
					</p:panelGrid>
				</h:form>
			</p:layoutUnit>
			
			<!-- ADICIONAR FOTO PRINCIPAL -->
			<p:dialog widgetVar="dialogUploadFoto" modal="true" header="Upload Foto" width="auto" showEffect="fade" 
					hideEffect="fade" resizable="false" id="uploadFotoDialog">
				
				<h:form id="formUploadAvatar" enctype="multipart/form-data">
					<p:fileUpload value="#{arquivoBean.uploadFileAvatar}" mode="simple" />
					<div align="right" class="buttonDataGridDocs">
						<p:commandButton value="Anexar" actionListener="#{arquivoBean.handleFileUploadAvatar}" oncomplete="dialogUploadFoto.hide()" ajax="false"/>
					</div>
				</h:form>
				
			</p:dialog>
			
			
			
		</ui:define>
	</ui:composition>
</html>